package net.hctek.identity.bean;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.*;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

/** 
* @author Ken 384755534@qq.com: 
* @version 创建时间：2017年2月20日 下午12:44:11 
* 类说明 :用户模型
*/
@Entity @Table(name="Broadcast_USER", 
	indexes={@Index(columnList="USER_ID", name="IDX_USER_ID")})
@Cache(usage=CacheConcurrencyStrategy.READ_WRITE)
public class User implements Serializable {

	private static final long serialVersionUID = 1L;
	
	
	/** 账号 */
	@Id @Column(name="USER_ID", length=50)
	private String userId;
	/** 密码	 */	
	@Column(name="PASS_WORD", length=50)
	private String passWord;
	/** 性别	 */	
	@Column(name="USER_SEX", length=4)
	private String userSex;
	/** 种族	 */	
	@Column(name="USER_RACE",length=50)
	private String userRace;
	/** 语言	 */	
	@Column(name="USER_LANGUAGE",length=50)
	private String userLanguage;
	/** 邮箱	 */	
	@Column(name="USER_MAILBOX",length=50)
	private String userMailBox;
	/** 手机号码	 */	
	@Column(name="USER_PHONENUMBER",length=50)
	private String userPhoneNumBer;
	
	
	//删除标志
	@Column(name="del_Flag")
	private String delFlag = "1";
		
	/** 用户与文件存在N-N关联 */
	@ManyToMany(fetch=FetchType.EAGER,targetEntity=Files.class,mappedBy="users")
	private Set<Files> files = new HashSet<>();

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getPassWord() {
		return passWord;
	}

	public void setPassWord(String passWord) {
		this.passWord = passWord;
	}

	public String getUserSex() {
		return userSex;
	}

	public void setUserSex(String userSex) {
		this.userSex = userSex;
	}

	public String getUserRace() {
		return userRace;
	}

	public void setUserRace(String userRace) {
		this.userRace = userRace;
	}

	public String getUserLanguage() {
		return userLanguage;
	}

	public void setUserLanguage(String userLanguage) {
		this.userLanguage = userLanguage;
	}

	public String getUserMailBox() {
		return userMailBox;
	}

	public void setUserMailBox(String userMailBox) {
		this.userMailBox = userMailBox;
	}

	public String getUserPhoneNumBer() {
		return userPhoneNumBer;
	}

	public void setUserPhoneNumBer(String userPhoneNumBer) {
		this.userPhoneNumBer = userPhoneNumBer;
	}

	public String getDelFlag() {
		return delFlag;
	}

	public void setDelFlag(String delFlag) {
		this.delFlag = delFlag;
	}

	@Override
	public String toString() {
		return "User [userId=" + userId + ", passWord=" + passWord + ", userSex=" + userSex + ", userRace=" + userRace
				+ ", userLanguage=" + userLanguage + ", userMailBox=" + userMailBox + ", userPhoneNumBer="
				+ userPhoneNumBer + ", delFlag=" + delFlag + ", files=" + files + "]";
	}

	
	

	
}
